package com.zengqingfa.zookeeper.demo.rest;

import com.zengqingfa.zookeeper.demo.api.ZkApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @fileName: ZookeeperRest
 * @author: zengqf3
 * @date: 2021-4-10 11:11
 * @description:
 */
@RestController
@RequestMapping("/zk")
@Slf4j
public class ZookeeperRest {
    @Autowired
    private ZkApi zkApi;

    @GetMapping(value = "/createNode")
    public boolean createNode(String path, String data) {
        log.debug("ZookeeperController create node {},{}", path, data);
        return zkApi.createNode(path, data);
    }
}
